import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
import yaml
from launch.substitutions import Command
from launch.substitutions import LaunchConfiguration

def generate_launch_description():
     
     ros2_video_node = Node(
          package='ros2_video',
          executable='ros2_video_node',
          parameters=[os.path.join(
                get_package_share_directory('ros2_video'), 'config', 'node_params.yaml'),
                        {'camera_info_url': 'package://ros2_video/config/camera_info.yaml'}],
          output='screen',
          emulate_tty=True,
          remappings=[
            ('/image_raw', '/camera/image'),
            ('/camera_info', '/camera/camera_info')
        ])

     return LaunchDescription([ros2_video_node])